import axios from 'axios'
let tools={
    get(src){
        axios.post(src).then((res)=>{
            return res
        }).catch((err)=>{
            return err
        })
    },
    // 时间戳换成年月日
    formatTime(time){
        let t = new Date(time);
        let year = t.getFullYear()
        // 由于 getMonth 返回值会比正常月份小 1
        let month = t.getMonth() + 1
        let day = t.getDate()
        let hours = t.getHours()
        let minutes = t.getMinutes()
        let seconds = t.getSeconds()
        // 前十月份加上0
        month = month > 9 ? month : `0${month}`
        day = day > 9 ? day : `0${day}`
        return {
            year,month,day
        }
    },
    /*
    620200 62省id 2市id
    632700 63省id 27市id
    110000 北京
    */
    formatArea(code){

    }
}
export default tools